Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sublime-syntax.json #3010

Merged
merged 4 commits into from
Oct 26, 2023
Merged

add sublime-syntax.json #3010

merged 4 commits into from
Oct 26, 2023

Conversation

Freed-Wu
Copy link
Contributor

src/schemas/json/sublime-syntax.json Outdated Show resolved Hide resolved
src/schemas/json/sublime-syntax.json Outdated Show resolved Hide resolved
src/schemas/json/sublime-syntax.json Outdated Show resolved Hide resolved
@Freed-Wu
Copy link
Contributor Author

Fixed.

src/schemas/json/sublime-syntax.json Show resolved Hide resolved
src/schemas/json/sublime-syntax.json Show resolved Hide resolved
src/schemas/json/sublime-syntax.json Show resolved Hide resolved
@Freed-Wu
Copy link
Contributor Author

Add URL, pattern, descriptions.

@EmilyGraceSeville7cf
Copy link
Contributor

EmilyGraceSeville7cf commented Jun 17, 2023

@Freed-Wu, you can also add completion for some common scopes using this technique:

  • list common scopes as properties
  • allow additional properties via additionalProperties to permit any not common scopes

P.S. to fix issue with build failure change test/sublime-syntax/cmd-help.sublime-syntax to test/sublime-syntax/cmd-help.sublime-syntax.json or test/sublime-syntax/cmd-help.json.

@Freed-Wu
Copy link
Contributor Author

Add extension for test sublime syntax. Remove addionalProperties to permit any not common scopes.

src/schemas/json/sublime-syntax.json Outdated Show resolved Hide resolved
src/schemas/json/sublime-syntax.json Outdated Show resolved Hide resolved
src/schemas/json/sublime-syntax.json Outdated Show resolved Hide resolved
src/schemas/json/sublime-syntax.json Outdated Show resolved Hide resolved
src/schemas/json/sublime-syntax.json Outdated Show resolved Hide resolved
src/api/json/catalog.json Outdated Show resolved Hide resolved
@Freed-Wu
Copy link
Contributor Author

Fixed.

@Freed-Wu
Copy link
Contributor Author

Can scope name have some recommended values? https://www.sublimetext.com/docs/scope_naming.html lists the recommend values for many scope names and corresponding documents.

@hyperupcall
Copy link
Member

@Freed-Wu If scope values are strings and you want to recommend ones in particular, I think you can use a pattern like this:

{
  "oneOf": [
    {
      "type": "string",
      "enum": ["one", "two", "three"]
    },
    {
      "type": "string"
    }
  ]
}

@madskristensen
Copy link
Contributor

Is this ready to be merged?

@Freed-Wu
Copy link
Contributor Author

Freed-Wu commented Jul 8, 2023

If scope values are strings and you want to recommend ones in particular

Can we provide a description for every scope?

Is this ready to be merged?

If any recommended value for scope is not recommended, it should be enough.

@hyperupcall
Copy link
Member

@Freed-Wu I'm not sure. What comes to mind is something like this:

{
  "oneOf": [
    {
      "type": "string",
      "enum": ["scope1"],
      "description": "Description 1"
    },
    {
      "type": "string"
      "enum": ["scope2"],
      "description": "Description 2"
    },
    {
      "type": "string"
    }
  ]
}

But I'm not sure if it actually works, you can test if it does, though.

@hyperupcall
Copy link
Member

hyperupcall commented Jul 11, 2023

@Freed-Wu My earlier comment seems incorrect, I have recently found out that you need to use anyOf instead of oneOf.

@Freed-Wu
Copy link
Contributor Author

Can scope name have some recommended values?

It is hard because scope, meta_scope, captures can be many scope names like

https://github.com/vuejs/vue-syntax-highlight/tree/HTML.yaml#L280:

# ...

contexts:
  # ...
  style-type-attribute:
    - match: (?i)\btype\b
      scope: meta.attribute-with-value.html entity.other.attribute-name.html
      set:
        - meta_content_scope: meta.tag.style.begin.html meta.attribute-with-value.html
        - match: =
          scope: punctuation.separator.key-value.html
          set:
            - meta_content_scope: meta.tag.style.begin.html meta.attribute-with-value.html
            - include: style-type-decider
        - match: (?=\S)
          set: style-css

That is, if we want to recommend scope_a, scope_b, scope_c, any combination of scope_a, scope_b, scope_c is legal.

@github-actions
Copy link
Contributor

This PR is stale because it has been open 60 days with no activity. Comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale PR is stale and will be closed in 7 days(auto-generated by stale action) label Oct 22, 2023
@hyperupcall
Copy link
Member

hyperupcall commented Oct 23, 2023

CI was failing because AJV Strict Mode caught multiple errors in the schema. I have made fixes and I will merge the result unless anybody thinks otherwise

@github-actions github-actions bot removed the Stale PR is stale and will be closed in 7 days(auto-generated by stale action) label Oct 24, 2023
@hyperupcall hyperupcall merged commit aa4a596 into SchemaStore:master Oct 26, 2023
3 checks passed
jmatias pushed a commit to jmatias/schemastore that referenced this pull request Oct 26, 2023
Co-authored-by: Keith Hall <[email protected]>
Co-authored-by: Edwin Kofler <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants